package com.zwh.modules.datamax.controller;

import com.zwh.modules.datamax.entity.DataMax;
import com.zwh.modules.datamax.service.FlowableService;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/a/flowable")
public class FlowableDemoController {

    @Autowired
    FlowableService flowableService;

    @RequestMapping("/startProcess")
    @ResponseBody
    public List<DataMax> startProcess(DataMax dataMax){
        flowableService.startProcess("assignName");
        return null;
    }
    @RequestMapping("/getTasks")
    @ResponseBody
    public List<Task> getTasks(DataMax dataMax){
        return flowableService.getTasks("assignName");
    }
}
